import { useAuthed } from '~/composables/useAuthed';

export default defineRoute(() => [
  {
    path: '/user',
    component: Layouts.default,
    beforeEnter: () => {
      return useAuthed().value || { name: RN.INDEX };
    },
    children: [
      {
        path: '',
        name: RN.USER,
        component: () => import('./index.vue'),
        redirect: { name: RN.USER_ACCOUNT },
        children: [
          {
            path: 'account',
            name: RN.USER_ACCOUNT,
            component: () => import('./account/index.vue'),
          },
          {
            path: 'transactions',
            name: RN.USER_TRANSATIONS,
            component: () => import('./transactions/index.vue'),
          },
          {
            path: 'user-history',
            name: RN.USER_GAMEHISTORY,
            component: () => import('./gameHistory/index.vue'),
          },
          {
            path: 'profit-daily',
            name: RN.USER_PROFITDAILY,
            component: () => import('./profit/index.vue'),
          },
          {
            path: 'sessions',
            name: RN.USER_SESSIONS,
            component: () => import('./sessions/index.vue'),
          },
        ],
      },

    ],
  },
]);
